import request from '@/utils/request'

// 开始新的销售
export function makeNewOrder(params) {
  return request({
    url: '/order/makeNewOrder',
    method: 'get',
    params: params
  })
}

// 录入订单明细
export function enterItem(data) {
  return request({
    url: '/order/enterItem',
    method: 'post',
    data: data
  })
}

// 根据座位号查找订单信息
export function getOrderInfoByseatNumber(params) {
  return request({
    url: '/order/returnOrder',
    method: 'get',
    params: params
  })
}

// 删除订单项
export function delOrderItem(params) {
  return request({
    url: '/order/deleteOrderItem/' + params.itemSn,
    method: 'delete',
    params: params
  })
}

// 修改订单项数量
export function updateOrderItem(data) {
  return request({
    url: '/order/changeQuantity',
    method: 'post',
    data: data
  })
}

// 挂单
export function handUpOrder(data) {
  return request({
    url: '/order/handUpOrder',
    method: 'get',
    params: {
      seatNumber: data
    }
  })
}

// 下单
export function pendingOrder(data) {
  return request({
    url: '/order/pendingOrder',
    method: 'get',
    params: {
      seatNumber: data
    }
  })
}

// 结算
export function endOrder(data) {
  return request({
    url: '/order/endOrder',
    method: 'get',
    params: {
      seatNumber: data
    }
  })
}

// 支付宝支付
export function payment(params) {
  return request({
    url: '/alipay/pay',
    method: 'get',
    params: params
  })
}

// 现金支付
export function makePayment(params) {
  return request({
    url: '/order/makePayment',
    method: 'get',
    params: params
  })
}
